// arg0 - id of entity
var __theid;
__theid = argument0;

for(i=0;i<ds_list_size(EntityPickerManager.entityList); i+=1)
{
    _theent = ds_list_find_value(EntityPickerManager.entityList, i);

    if (_theent.entity == noone)
    {
        if (_theent.controlname == __theid)
        {
            return _theent;
        }
    }
}

return noone;
